#include "CRGB.h"

CCRGB::CCRGB(double red, double green, double blue):red(red),green(green),blue(blue)
{

}

CCRGB CCRGB::operator*(double t)
{
    
    this->blue*= t;
    this->green*= t;
    this->red*= t;
    return *this;
}

CCRGB CCRGB::operator+(CCRGB c)
{
    this->blue += c.blue;
    this->green += c.green;
    this->red += c.red;
    return *this;
}



void CCRGB::Normalize()
{
    red = (red < 0.0) ? 0.0 : ((red > 1.0) ? 1.0 : red);
    green = (green < 0.0) ? 0.0 : ((green > 1.0) ? 1.0 : green);
    blue = (blue < 0.0) ? 0.0 : ((blue > 1.0) ? 1.0 : blue);
}
